{include file="header"}
 <style type="text/css"> img{border: 0;}
ul{list-style: none outside none;margin: 0;padding: 0;}
body .mainmenu:after{clear: both;content: " ";display: block;}
body .mainmenu li{float: left;margin-left: 2.5%;margin-top: 2.5%;width: 22%;border-radius: 3px;overflow: hidden;}
@media screen and (max-width: 1200px){body .mainmenu li{width: 30%;}} @media screen and (max-width: 800px){body .mainmenu li{width: 95%;}} body .mainmenu li a{display: block;color: #FFF;text-align: center}
body .mainmenu li b{display: block;height: 200px;padding: 10px;}
body .mainmenu li img{width: 100%;height: 100%;}
body .mainmenu li span{display: block;height: 40px;line-height: 40px;background-color: #ff8a00;color: #fff;font-size: 14px;}
body .set{padding: 10px;text-align: left;}
body .mainmenu li{background-color: #ffffff;border: 3px solid #ff8a00;}
</style>
<div class="x-body">
	<xblock>
		<a href="javascript:location.reload();" class="layui-btn layui-btn-warm">
			<i class="iconfont"></i>主题模板
		</a>
		<a class="layui-btn" href="http://www.115cms.com/muban.html" target="_blank"><i class="layui-icon"></i>在线模板</a>
		{:hook('admincommuban')}
	</xblock>
    <ul class="mainmenu">
        <?php foreach (getDir('app/template/',1) as $v=>$m){?>
        {if file_exists('app/template/'.$m.'/config.php')}
        <li>
            <b><img src="{:m_config($m,'pic')}"></b>
            <span><a> {:m_config($m,'title')} V{:m_config($m,'banben')} @{:m_config($m,'author')}</a></span>
            <div class="set">
                {if jiami(get_config('template','wap'),'DECODE','115cms',0)==m_config($m,'template')||jiami(get_config('template','name'),'DECODE','115cms',0)==m_config($m,'template')}
                {if m_config($m,'admin')==1}
                <button type="button" onclick="x_admin_show('{:m_config($m,"title")}设置','{:url('admin/com/muban_config',array('id'=>m_config($m,'template')))}')" class="layui-btn layui-btn-sm">设置</button>
                {/if}
                <button type="button" onclick="x_admin_show('{:m_config($m,"title")}广告','{:url('admin/com/ad',array('id'=>m_config($m,'template')))}')" class="layui-btn layui-btn-sm" style="background-color: #ff8a00;">广告</button>
                {else/}
                <button type="button" class="layui-btn layui-btn-sm layui-btn-danger del_t" url="{:url('admin/api/unmuban')}?id={:m_config($m,'template')}" name="确定要删除这个模板吗？<br>删除后不可恢复请做好备份">删除</button>
                {/if}
                {:hook('admincommubans',array('id'=>m_config($m,'template')))}
                <a href="http://www.115cms.com/m_html/{:m_config($m,'template')}.html" target="_blank" class="layui-btn layui-btn-sm" style="margin-bottom: 10px;float: right;">详情>></a>
            </div>    
            <div class="set" style="border-top: 2px solid #ff8a00;">
                <button {if jiami(get_config('template','wap'),'DECODE','115cms',0)==m_config($m,'template')}style="background-color: #1e9fff;" {/if} type="button" class="layui-btn layui-btn-sm del_t" url="{:url('admin/api/addmuban')}?idwap={:m_config($m,'template')}" name="确定要启动这个模板作为手机模板吗？">启动wap{if jiami(get_config('template','wap'),'DECODE','115cms',0)==m_config($m,'template')}[使用中..]{/if}</button>
                <button {if jiami(get_config('template','name'),'DECODE','115cms',0)==m_config($m,'template')}style="background-color: #1e9fff;" {/if} type="button" class="layui-btn layui-btn-sm del_t" url="{:url('admin/api/addmuban')}?id={:m_config($m,'template')}" name="确定要启动这个模板作为PC模板吗？">启动pc{if jiami(get_config('template','name'),'DECODE','115cms',0)==m_config($m,'template')}[使用中..]{/if}</button>
            </div>
        </li>
        {/if}
        <?php } ?>
    </ul>
</div>
{include file="footer"}